﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

enum specialtiesList{KST, FA, KTT, KMPT, RRR, TT };
enum universitiesList {TU, SU, MGU, VTU };
enum facultiesList {FKSU, AF, HHHH }

class Student : ICloneable, IComparable<Student>
{
    private string firstName;
    private string secondName;
    private string thirdName;
    private int ssn;
    private string address;
    private int phone;
    private string email;
    private int course;
    private specialtiesList specialty;
    private universitiesList university;
    private facultiesList faculty;

    public Student(string firstName, string secondName, string thirdName, int ssn, string address, int phone, string email, int course, specialtiesList specialty, universitiesList university, facultiesList faculty)
    {
        this.firstName = firstName;
        this.secondName = secondName;
        this.thirdName = thirdName;
        this.ssn = ssn;
        this.address = address;
        this.phone = phone;
        this.email = email;
        this.course = course;
        this.specialty = specialty;
        this.university = university;
        this.faculty = faculty;
    }

    public Student(string firstName, string secondName, string thirdName, int ssn)
    {
        this.firstName = firstName;
        this.secondName = secondName;
        this.thirdName = thirdName;
        this.ssn = ssn;
    }

    public string FirstName
    {
        get
        {
            return firstName;
        }
        set
        {
            firstName = value;
        }
    }

    public string SecondName
    {
        get
        {
            return secondName;
        }
        set
        {
            secondName = value;
        }
    }

    public string ThirdName
    {
        get
        {
            return thirdName;
        }
        set
        {
            thirdName = value;
        }
    }

    public int Ssn
    {
        get
        {
            return ssn;
        }
        set
        {
            ssn = value;
        }
    }

    public string Address
    {
        get
        {
            return address;
        }
        set
        {
            address = value;
        }
    }

    public int Phone
    {
        get
        {
            return phone;
        }
        set
        {
            phone = value;
        }
    }

    public string Email
    {
        get
        {
            return email;
        }
        set
        {
            email = value;
        }
    }

    public int Course
    {
        get
        {
            return course;
        }
        set
        {
            course = value;
        }
    }

    public specialtiesList Specialty
    {
        get
        {
            return specialty;
        }
        set
        {
            specialty = value;
        }
    }

    public universitiesList University
    {
        get
        {
            return university;
        }
        set
        {
            university = value;
        }
    }

    public facultiesList Faculty
    {
        get
        {
            return faculty;
        }
        set
        {
            faculty = value;
        }
    }

    public override bool  Equals(object obj)
    {
 	    Student secondStudent = obj as Student;
        return this.ssn.Equals(secondStudent.ssn);
    }

    public override string  ToString()
    {
 	    string result = string.Format("{0} {1} {2} \n Course - {3}\n Specialty - {4}\n ", firstName, secondName, thirdName,course, specialty );
        return result;
    }

    public override int GetHashCode()
    {
        return firstName.GetHashCode() ^ secondName.GetHashCode() ^ thirdName.GetHashCode();
    }

    public static bool operator ==(Student first, Student second)
    {
        if (first.Equals(second))
            return true;
        return false;
    }

    public static bool operator !=(Student first, Student second)
    {
        return !(first == second);
    }

    public object Clone()
    {
        Student newStudent = new Student(firstName, secondName, thirdName, ssn, address, phone,
            email, course, specialty, university, faculty);
        return newStudent;
    }

    public int CompareTo(Student other)
    {
        if (this.firstName.CompareTo(other.firstName) != 0)
        {
            if(this.firstName.CompareTo(other.firstName)==-1) return 1;
            return -1;
        }
        if(this.ssn.CompareTo(other.ssn)==-1) return 1;
        if (this.ssn.CompareTo(other.ssn) == 1) return -1;
        return 0;
    }
}

